<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>基本设置</title>
    {template 'stourtravel/public/public_min_js'}
    {php echo Common::getCss('style.css,base.css,jqtransform.css,base_new.css'); }
    {php echo Common::getScript('config.js,jquery.jqtransform.js,jquery.colorpicker.js');}
    {php echo Common::getScript("uploadify/jquery.uploadify.min.js"); }
    {php echo Common::getCss('uploadify.css','js/uploadify/'); }
    <style>
        #uploadify-queue{display: none;}
    </style>
</head>
<body>

    <table class="content-tab">
        <tr>
            <td width="119px" class="content-lt-td" valign="top">
                {template 'stourtravel/public/leftnav'}
                <!--右侧内容区-->
            </td>
            <td valign="top" class="content-rt-td">
                <form id="configfrm">
                    <div class="w-set-con">
                        <div class="cfg-header-bar">
                            <a href="javascript:;" class="fr btn btn-primary radius mt-6 mr-10" onclick="window.location.reload()">刷新</a>
                        </div>

                        <div class="w-set-nr">
                            <div class="picture ml-10">
                                <ul class="info-item-block">
                                    <li>
                                        <span class="item-hd" style="width: 140px !important;">微信小程序：(App ID{Common::get_help_icon('cfg_global_client_appkey')})</span>
                                        <div class="item-bd" style="padding-left: 145px !important;">
                                            <input type="text" name="cfg_global_client_appkey" id="cfg_global_client_appkey" class="input-text w300" >
                                        </div>
                                    </li>
                                    <li>
                                        <span class="item-hd" style="width: 140px !important;">(App Secret{Common::get_help_icon('cfg_global_client_appsecret')})</span>
                                        <div class="item-bd" style="padding-left: 145px !important;">
                                            <input type="text" name="cfg_global_client_appsecret" id="cfg_global_client_appsecret" class="input-text w300">
                                        </div>
                                    </li>

                                </ul>

                            </div>
                            <div class="clear clearfix mt-10">
                                <a class="btn btn-primary radius size-L ml-115" href="javascript:;" id="btn_save">保存</a>
                                <input type="hidden" name="webid" id="webid" value="0">
                            </div>
                        </div>
                    </div>
                </form>
            </td>
        </tr>
    </table>

<script>
    $(document).ready(function () {
        //配置信息保存
        $("#btn_save").click(function () {
            Config.saveConfig(0);
        });
        getConfig(0);
    });

    //获取配置
    function getConfig(webid)
    {
        var fields = ['cfg_global_client_appkey','cfg_global_client_appsecret'];
        Config.getConfig(webid,function(data){
            if(data.cfg_global_client_appkey)
            {
                $("#cfg_global_client_appkey").val(data.cfg_global_client_appkey);
            }
            if(data.cfg_global_client_appsecret)
            {
                $("#cfg_global_client_appsecret").val(data.cfg_global_client_appsecret);
            }
        },fields)
    }
</script>
</body>
</html>
